﻿@extends('home.base.headers')
@section('content')
<div class="hr-10"></div>
<div class="g">
   <!--面包屑 -->
<div class="breadcrumb-area fcn">
		<a href="{{ asset('/') }}" title="首页">首页</a>&nbsp;>&nbsp;
	
	<span>手机</span>
</div>
<div class="hr-10"></div><div class="layout">
	<!-- 20140726-商品类别-start -->
	<div class="pro-cate-area">
		<!-- 20140726-商品类别-属性-start -->
		<div class="pro-cate-attr clearfix">
			<div class="p-title">分类：</div>
			<div class="p-default">
				<ul>
                    <li id="first-category" class="selected"><a href="/list-36">全部</a></li>
					<!--<li class="selected"><a href="javascript:;">全部</a></li>-->
				</ul>
			</div>
			<!-- 二级虚拟分类 -->
			<div class="p-values">
				<div class="p-operate" style="display: none;">
					<!-- 追加ClassName： more-expand more-drop -->
					<a href="javascript:;" onclick="ec.product.more(this)" class="more more-expand">更多<s></s></a>
				</div>

				<!-- 一行的高度为30px,显示n行，p-expand的高度为nx30 -->
				<!-- 遍历商品分类得到id号 -->
				<div class="p-expand">
					<ul class="clearfix">
					@foreach ($goodscate as $goodscateV)
							@if ($id == $goodscateV->cid)
		                    	<li><a href="/list-75">{{ $goodscateV->name }}</a></li>
		                    @endif
	                @endforeach
					</ul>
				</div>
			</div>
			
		</div><!-- 20140726-商品类别-属性-end -->
		
		<!-- 20140726-商品类别-属性-start -->
        <!-- 20140726-商品类别-属性-end -->		
		<input type="hidden" value="{{ $cNum = 0 }}">

		<!-- 20140726-商品类别-排序-start -->
		<div class="pro-cate-sort clearfix">
			<div class="p-title">排序：</div>
			<div class="p-default">
				<ul>
					<li id="sort-default"><a href="/list/{{$id}}" onclick="ec.product.sort('default')">默认</a></li>
				</ul>
			</div>
			<div class="p-values">
				<div class="p-expand">					
					<ul class="clearfix">
					    <!-- 升序选择（从低到高）： sort-asc selected   降序选择（从高到低）： sort-desc selected -->
						<li id="sort-price"><a href="/list/{{$id}}/PriceA">价格升序<s></s></a></li>
						<li id="sort-price"><a href="/list/{{$id}}/PriceD">价格降序<s></s></a></li>
					</ul>
				</div>
			</div>
		</div><!-- 20140726-商品类别-排序-end -->
		
		<form id="listForm" method="post">
		

		</form>
		
	</div><!-- 20140726-商品类别-end -->

	<div class="hr-20"></div>
</div>				

<!--到货通知弹出框-->
<textarea id="product-arrival-html" class="hide">
	<div class="arrival-remind-area">
		<ul class="clearfix">
			<li id="arrival-email">
				<p class="a-title">邮件通知</p>
				<p id="account-email" class="a-txt">xxxxxxxxxxxxxxxxxxxx@huawei.com</p>
				<s></s>
			</li>
			<li id="arrival-mobile">
				<p class="a-title">短信通知</p>
				<p id="account-mobile" class="a-txt">185&nbsp;6644&nbsp;5856</p>
				<s></s>
			</li>		
		</ul>
	</div>
	<div class="box-custom-button">
		<input type="submit" class="box-ok box-button-style-1" value="提交"/>
	</div>
	<div id="arrival-error" class="box-form-tips hide">
		<span class="icon-error">输入有误</span>
	</div>
</textarea>
<input id='sField' type='hidden' value='default'/>
<input id='sType' type='hidden' value='desc'/>
<script src="{{ asset('home/js/new_list.min.js') }}"></script>
<script>
	ec.load("ec.pager");
</script>	


	<!-- 20140726-频道-列表-start -->
    <div class="channel-list">
        <!-- 20140727-商品列表-start -->
		<div class="pro-list clearfix">
			<ul>
			<!-- 遍历商品 -->
			@foreach ($goods as $gv)
				<!-- 如果商品的id　==　商品详情的gid 并且 商品的cid == 商品分类的id -->
				@if ($gv->id == $gv->gid && $gv->cid == $id)

		            	<li>
							<div class="pro-panels">
								<p class="p-img"><a target="_blank" href="/product/22309363.html#308819390,36" title="{{ $gv->title }}"><img alt="{{ $gv->title }}" src="{{ asset('uploads/'.$gv->pic0) }}"/></a></p>
								<p class="p-name"><a target="_blank" href="/product/22309363.html#308819390,36" title="{{ $gv->title }}">{{ $gv->title }}<span class="red">{{ $gv->ftitle }}</span></a></p>
								<p class="p-price"><b>&yen;@if ($gv->price != ''){{ $gv->price }}@else {{ $gv->hwprice }}@endif</b></p>
								<div class="p-button clearfix">
									<table colspan="0" border="0" rowspan="0">
										<tbody>
											<tr>
												<td><a target="_blank" href="/product/22309363.html#308819390,36" class="p-button-cart"><span>{{ $gv->buy }}</span></a></td>
												<input type="hidden" value="{{ $cNum = 0 }}">
												<td><label class="p-button-score"><span>
													@foreach ($storecomment as $cv)
														@if ($cv->commentGid == $gv->gid)
															<input type="hidden" value="{{ $cNum++ }}">
														@endif
													@endforeach
												{{ $cNum }}人评价</span></td>
											</tr>
										</tbody>
									</table>
								</div>
					
								<s class="p-tag">

									@if ($gv->biaoqian == '新品')
										<img alt="{{ $gv->title }}" src="{{ asset('/home/picture/1474556767268.jpg') }}" />
		                            @elseif ($gv->biaoqian == '热卖')
										<img alt="{{ $gv->title }}" src="{{ asset('/home/picture/1474556795010.jpg') }}" />
		                            @elseif ($gv->biaoqian == '直降')
										<img alt="{{ $gv->title }}" src="{{ asset('/home/picture/1474556828097.jpg') }}" />
		                            @elseif ($gv->biaoqian == '爆款')
										<img alt="{{ $gv->title }}" src="{{ asset('/home/picture/1474556959389.jpg') }}" />
		                            @elseif ($gv->biaoqian == '首发')
										<img alt="{{ $gv->title }}" src="{{ asset('/home/picture/1474556814096.jpg') }}" />
		                            @elseif ($gv->biaoqian == '特惠')
										<img alt="{{ $gv->title }}" src="{{ asset('/home/picture/1474556855706.jpg') }}" />
		                            @endif
								</s>
							</div>
						</li>

				@endif

			@endforeach
			</ul>

		</div>
		<!-- 20140727-商品列表-end -->
		<!-- 分页-start -->
		<div id="list-pager-36" class="pager">
		    <span class="hide">
			    <a href="/list-36-1" title="手机 第1页">第1页</a>&nbsp;&nbsp;
			    <a href="/list-36-2" title="手机 第2页">第2页</a>&nbsp;&nbsp;
		    </span>
	    </div>
    </div><!-- 20140726-频道-列表-end -->
<!--弹出层-成功添加到购物车 -->
<textarea id="cart-tips" class="hide">
<div class="pro-add-success" style="margin:-14px -30px 0;">
	<dl>
		<dt><s></s></dt>
		<dd>
			<div id="cart-briefName" class="pro-add-success-name">华为 Ascend P1 U9200 3G手机（晶钻黑）WCDMA</div>
			<div class="pro-add-success-msg">成功加入购物车!</div>
			<div class="pro-add-success-total">购物车中共&nbsp;<b id="cart-total">0</b>&nbsp;件商品，金额合计&nbsp;<b  id="cart-price">¥&nbsp;2699</b></div>
			<div class="pro-add-success-button"><a href="javascript:;" class="box-ok button-style-1 button-go-cart" title="去购物车结算">去结算</a><a class="box-cancel button-style-4 button-walking" href="javascript:;" title="继续逛逛">继续逛逛&nbsp;>></a></div>
		</dd>
	</dl>
</div>
</textarea>
<!-- 20131218-商品简介-弹出层-成功添加到购物车-end -->

<!--弹出层-添加到购物车失败 -->
<textarea id="popup-tips" class="hide">
    <!-- 20131230-商品简介-弹出层-添加到购物车失败-start -->
	<div class="pro-add-error" style="margin-top:-40px;">
		<i></i>
		<div id="popup-tips-msg" class="pro-add-error-msg">非常抱歉！该商品不能单独销售！</div>
		<div class="pro-add-error-button"><a href="javascript:;"  title="知道了" class="box-cancel button-style-4 button-par-define">知道了</a></div>
	</div>
</textarea>
<!-- 20131230-商品简介-弹出层-添加到购物车失败-end -->


                        

<form action="#" id="gotourl" method="get"></form>
<script>
	//去结算
	ec.product.gotoshoppingCart = function(){
		//BI统计
		_paq.push(['trackLink','加入购物车-去支付', 'link', ' ']);
		ec.code.addAnalytics({hicloud:true});
		setTimeout(function () {
			//var url = '/order/shoppingCart';
			var url = 'http://cart.vmall.com/cart/cart.html';
			$('#gotourl').attr('action', url).submit();
		}, 500);
	};
</script><div class="hr-40"></div>
<script>
    ec.ready(function(){
        //封装已选属性列表
        var attrList = [];
	    ec.product.renderPage(36, attrList, $("#sField").val(),  $("#sType").val(), {
		    pageNumber : 1,
		    totalPage : 2,
		    recordCount : 29
	    });
    });
    
    /**
     *描述：当点击一级分类，在展现属性中，可能出在存在相同的属性名称。
     *所以现在暂时弥补的方法  当点击分类---"全部"的时候，隐藏下面属性的列
     *@lifeng
    */
    ec.ready(function(){
    	var result = $("#first-category").attr("class");
    	if(result == "selected"){
    		//把分类下面的属性全部隐藏
    		$(".pro-cate-area").find("div[id^='pro-cate-attr-']").hide();
    	}
    })
    
</script>
@endsection